#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int f(int m, int n)
{
    int chushu, yushu;
    for (yushu = m % n; yushu != 0; yushu = m % n)
    {
        m = n;
        n = yushu;
    }
    return n;
}

int g(int m, int n)
{
    int s;
    s = m * n / f(m, n);
    return s;
}

int main()
{
    int m, n, temp;
    scanf("%d %d", &m, &n);
    if (m > n)
    {
        m = m;
        n = n;
    }
    else
    {
        temp = m;
        m = n;
        n = temp;
    }
    int max, min;
    max = f(m, n);
    min = g(m, n);
    printf("%d %d", max, min);
    return 0;
}